package com.ray.mybatisdemo.mapper;


import com.ray.mybatisdemo.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * User: Ray.Shaw <p />
 * Time: 2019/10/30 15:54  <p />
 * Version: V1.0  <p />
 * Description:  <p />
 */
// @Repository 可要可不要(因为已经在入口加上了@MapperScan扫描),加上可以防止idea注入UserMapper标红线
@Repository
public interface UserMapper {

    @Select("select * from user where id = #{id}")
    User selectOne(@Param("id") Integer id);

    List<User> selectAll();
}
